<template>
  <div class="report-container">
    <van-nav-bar
      title="报告详情"
      left-text="返回"
      right-text=""
      left-arrow
      @click-left="onClickLeft"
    />
    <!-- <div class="report-content" style="background-color:#000;">
      <img :src="pdfUrl" style="width:100%;height:92vh;object-fit: contain;background:#fff;">
    </div> -->
 
     <!-- <van-popup closeable v-model="dialogBg" position="bottom" :style="{ height: '100%' }">
       <iframe :src="pdfUrl" frameborder="0" style="width:100%;height:88%;margin-top:12%;"></iframe>
    </van-popup> -->
    
    
       <van-popup closeable v-model="dialogBg" position="bottom" :style="{ height: '100%',background:'#000'}">
            <img :src="pdfUrl" style="width:100%;height:88%;margin-top:12%;object-fit: contain;background:#fff;">
        </van-popup>
  </div>
</template>
<script>
// import { Icon, Overlay, Toast, NavBar,Popup } from "vant";
import { Icon, Overlay, Toast, NavBar,Dialog, Tab, Tabs, ActionSheet, Tag, Button, Field, List, CellGroup,Popup } from "vant";
import notFind from "@/view/common/notFind";
export default {
  name: "report",
  components: {
    [Icon.name]: Icon,
    [NavBar.name]: NavBar,
    [Overlay.name]: Overlay,
     [Popup.name]: Popup,
  },
  data() {
    return {
       notFind,
      dialogBg:false,
      show: false,
      agePassword: "",
      pdfUrl:"",
      checkdate:""
    };
  },
  created(){
    this.zid=this.$route.query.zid || 0;
    this.hoscode=this.$route.query.hoscode || 0;
    this.checkno=this.$route.query.checkno || 0;
  this.checkdate=this.$route.query.checkdate || 0;
    
    // let url=this.$API.DOMAIN_NAME+this.$API.CLOUDDIAGNOSIS_VIEWREPORT+'?id='+this.zid+'&.pdf';
    // this.pdfUrl= `${this.$API.DOMAIN_NAME}/web/pdf/web/viewer.html?file=${encodeURIComponent(url)}`;
    this.initMethod()
  },
  computed: {},
  methods: {
    initMethod() {
      Toast.loading({ message: "加载中...", forbidClick: true });
      let zid=70;// 70  63  
      //let url=this.$API.MOBILE_REPORT_viewreportossv202+"/"+zid
      let url=this.$API.QUERY_CHECK_SEARCHv2
      let para={ zid: this.zid,hospitalId:this.hoscode,checkNo:this.checkno,checkdate:this.checkdate }
      
      this.$http
        .get(url,para)
        .then((res) => {
          Toast.clear();
          if (res.code == 200) {
            //this.pdfUrl=res.data;
            this.pdfUrl=res.data.reportUrl;
             
           this.dialogBg=true;
          } else {
            Toast.fail(res.msg);
          }
        });
    },
    onClickLeft() {
      this.$router.back()
    },
    submit() {
      if (this.password.trim() !== this.agePassword.trim()) {
        return Toast.fail("两次输入密码不一致请重新输入");
      }
      if (this.password.trim().length < 6) {
        return Toast.fail("密码长度不够！");
      }
      Toast.loading({ message: "加载中...", forbidClick: true });
      this.$http
        .post(this.$API.SET_PASSWORD, { password: this.password })
        .then((res) => {
          Toast.clear();
          if (res.code == 1) {
            Toast.success("修改成功");
            setTimeout(() => {
              this.$router.push("/login");
            }, 1000);
          } else {
            Toast.fail(res.msg);
          }
        });
    },
  },
};
</script>
<style lang="less" scoped>
.report-container {
  width: 100%;
  height: 100%;
}
</style>
<style>
.report-container .van-nav-bar {
  background-color: #1989fa;
}
.report-container .van-nav-bar__title {
  color: #ffffff;
}
.report-container .van-nav-bar__text{
    color: #ffffff;
}
</style>


